home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / commercial / aspex / Models_MakeMods_MakeMods < prev    next >
Encoding:
Text File  |  1996-09-02  |  6.8 KB  |  233 lines

  1.  
  2. VRMLEyes demonstration version will load the VRML files supplied with the program, other VRML files will not be recognised.
  3.  
  4. However, the demo version will allow users to create their own shapes in the form of 
  5. simple textfiles. The program will respond to commands for the following basic shapes:
  6.  
  7. Sphere / Cube / Cone / Cylinder 
  8.  
  9. These shapes are just a taster of VRML, and tiny part of what VRML has to offer. VRML is designed to
  10. create entire 3D immersive and interactive worlds. As VRMLEyes develops it will support the richer behaviours of VRML 2 which include animation, Java scripting, 3D sound, collisions and more.
  11.  
  12.  
  13. A SIMPLE VRML FILE
  14. ~~~~~~~~~~~~~~~~~~
  15. All VRML files consist of a header followed by some information about the model, a Sphere for
  16. example is represented by the follwing text:
  17.  
  18. NOTE: VRMLEyes is case sensitive. 
  19.  
  20. EXAMPLE 1.   Sphere
  21. ~~~~~~~~~~~~~~~~~~~~
  22.  
  23. #VRML V1.0 ascii       # this is the header, it says
  24.                        # to VRMLEyes; " get your pen out
  25.                        # and get ready to start drawing" 
  26.  
  27. Sphere {
  28.     radius 2.0
  29. }                      # this is the first complete instruction
  30.                        # it is telling VRML to draw a Sphere
  31.                        # with a radius of 2 units
  32.  
  33. EXAMPLE 2.  Shading a shape using 'Materials' (add a bit of colour!).
  34. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35.  
  36. You can colour your shape how you like by including values (between 0 and 1) for each of the
  37. colours Red, Green and Blue. 
  38.  
  39. There are several nodes (commands) used to colour an object diffuse, emmisive, specular, shininess, ambient and transparency. VRMLEyes recognises these nodes.
  40.  
  41. diffuseColor simply 'colours' the shape.
  42.  
  43. A red Sphere
  44. ~~~~~~~~~~~~
  45.  
  46. #VRML V1.0 ascii           # header
  47.  
  48. Material {                 # get ready to do something like colour the object)
  49.  
  50. diffuseColor 1.0 0.0 0.0
  51. }                          # get ready with max red, no green and no blue
  52.                            # watch out for spelling and case!
  53. Sphere {
  54.     radius 2.0
  55. }                          # now draw the sphere, all in red
  56.  
  57.  
  58. Experiment with different colours:
  59.  
  60. Red     Green     Blue
  61. 1.0      0.0      0.0          (Pure red)
  62. 0.5      0.0      0.0          (dark red)
  63. 1.0      1.0      0.0          (Yellow)
  64. 1.0      0.0      1.0          (Magenta)
  65.  
  66. etc. 
  67.  
  68. The demo version also supports 'shininess'
  69.  
  70. Try amending the above example:
  71.             
  72. #VRML V1.0 ascii         
  73. Material {               
  74. diffuseColor 1.0 0.0 0.0
  75. shininess    0.1            # make the object shiny, value between 0 and 0.5
  76. }                        
  77. Sphere {
  78.     radius 2.0
  79. }                           # now draw the sphere, in shiny red
  80.  
  81.  
  82. Cube, Cylinder and Cone?
  83. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  84. Try writing new VRML textfiles to draw these other shapes on the screen.  
  85.  
  86. VRMLEyes demo version regognises the following style of commands:
  87. Don't forget the headers etc.
  88.  
  89. To make a cube
  90. ~~~~~~~~~~~~~~
  91. Cube {
  92.    height 2.0
  93.    width  4.0
  94.    depth  6.0
  95. }                           (make a cuboid 2x4x6 units)
  96.  
  97. To make a Cylinder
  98. ~~~~~~~~~~~~~~~~~~
  99. Cylinder {
  100.    height 4.0
  101.    radius 2.0
  102. }                           (make a cylinder 4 units high and 4 wide)
  103.  
  104. To make a Cone
  105. ~~~~~~~~~~~~~~
  106.  
  107. Cone {
  108.     height       6.0
  109.     bottomRadius 2.0
  110. }                           (make a cone which is 6 units high with a base 4 units wide)
  111.  
  112. NB.  The units can be of any desired measurement. If you chose centimeters as your base then all other measurements in the complete model should be centimeters as well. VRMLEyes can place your
  113. object accurately wherever desired.
  114.  
  115. PLACING A SHAPE
  116. ~~~~~~~~~~~~~~~
  117. VRMLEyes can be told to move a shape using the 'Translation' node.
  118.  
  119. The Translation node can be used to place an object accurately anywhere in 3D space relative 
  120. to the previous origin. This is achieved by defining a new position in the X, Y and Z planes.
  121.  
  122. First choose a scale, centimeters for example.
  123.  
  124. The following example draws one cube in the centre of the screen then draws as second cube to sit on top of it.
  125.  
  126. #VRML V1.0 ascii                 # header
  127.  
  128. Cube {
  129.   height 2.0                     # draw a cube 2x2x2 metres
  130.   width  2.0
  131.   depth  2.0
  132. }
  133. Translation {
  134.     translation 0.0 2.0 0.0      # translate, or move, the point of origin 2  in the Y plane.
  135.                                  # if the number was -2 then the origin would be moved downward
  136. }
  137. Cube {
  138.   height 2.0                     # Draw a second cube at the new origin
  139.   width  2.0
  140.   depth  2.0
  141. }
  142.  
  143. ROTATING A SHAPE
  144. ~~~~~~~~~~~~~~~~
  145. Each shape can be rotated in any direction by a specific amount in any direction. This function 
  146. is controlled by the Rotation Node. Its OK to think in degrees but you will need to convert all 
  147. your angles to radians before using them with VRML.
  148.  
  149.  
  150.  
  151. The following example describes a 'Cross' shape made from two cylinders. see example file 3.
  152. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153.  
  154. #VRML V1.0 ascii   
  155. Cylinder {
  156.   height 30.0
  157.   radius 2.0                          # draw a cylinder
  158. }
  159. Rotation {
  160.     rotation  0.0 0.0 1.0 1.0472      # rotate the cylinder in the Z axis by 1.0472
  161.                                       # radians (60 degrees). The figure 0.0 0.0 1.0
  162.                                       # represent the X, Y and Z axix. The Z axis is 
  163.                                       # set with a '1' followed by the angle in radians.
  164.                                       # 0.0 1.0 0.0 1.0472 would rotate the cylinder
  165.                                       # in the Y axis 
  166.                                                                         
  167. }
  168. Cylinder {
  169.   height 30.0
  170.   radius 2.0
  171.       
  172.                             
  173.  ***This example produces intersecting shapes, so the Z Buffer will need to be used.                   
  174.  
  175. RADIANS
  176. ~~~~~~~
  177. for those who can't remember school:
  178.  
  179. rad = (deg / 180) x 3.142
  180.  
  181.                        Common angles:
  182.                                        Degrees      Radians
  183.                                        30 deg       0.524 rad
  184.                                        60 deg       1.0472
  185.                                        90 deg       1.571
  186.                                        180 deg      3.142
  187.                                        270 deg      4.172
  188.  
  189. The products VRMLEyes an DaVinci90 will render raw VRML files as data or text files, which how they normally arrive. If the filetype is set to VRML then a VRML model can be loaded by double-clicking.
  190.  
  191.                                        
  192. With VRMLEyes demonstration one can can create quite complex shapes, colour them, move 
  193. and rotate them. Why not buy the complete version and join in at the start of the rapidly
  194. growing world of 3D.           
  195.  
  196.  
  197. VRMLEyes will also load and render any DaVinci90 3D model. DaVinci is a 3D modeller which could be refarded as a VRML editor.
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.